<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        ul {
            display: flex;
            padding-top: 100px;
        }

        ul li {
            float: left;
            list-style: none;
            flex: 1;
            text-align: center;
        }
    </style>
</head>

<body>
    <ul id="uu">
        <!-- <li>
            <img src="../images/0.png" alt="">
            <p>名字：</p>
            <p>价格：</p>
            <p>年龄：</p>
        </li> -->
    </ul>


    <script>
        let shu = [
            { id: 1, img: "../images/0.png", name: "高级技师1", price: "￥30", age: "18" },
            { id: 2, img: "../images/1.png", name: "高级技师1", price: "￥33", age: "17" },
            { id: 3, img: "../images/2.png", name: "高级技师1", price: "￥53", age: "22" },
            { id: 4, img: "../images/3.png", name: "高级技师1", price: "￥93", age: "14" }
        ]

        shu.forEach((item, index) => {
            uu.innerHTML += `  <li  idx="` + item.id + `">
            <img src="`+ item.img + `" alt="">
            <p>名字：`+ item.name + `</p>
            <p>价格：`+ item.price + `</p>
            <p>年龄：`+ item.age + `</p>
        </li>`
        })

        let lli = document.getElementsByTagName("li");
        // console.log(lli)
        // let aa = [...lli];
        lli = [...lli]
        lli.forEach((item, index) => {
            // console.log(item)
            lli[index].onclick = () => {
                open("2.html?id=" + lli[index].getAttribute("idx"))
            }
        })

    </script>
</body>

</html>